/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.ez2find.model;

import java.io.Serializable;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;

/**
 *
 * @author Owner
 */
@NamedQueries(value={@NamedQuery(name="listAllPersonals", query="SELECT p FROM Personal p"),
                     @NamedQuery(name="lastPersonalCode", query="SELECT MAX(p.code) FROM Personal p")})

@Entity
public class Personal extends Post implements Serializable{

    private int yourAge;
    private String am;
    private String seeking;
    //Permissions
    private boolean othersContact;
    @ManyToOne()
    private CategoriaPersonal personalCategorie;
    @OneToMany(mappedBy="personal",cascade=CascadeType.REMOVE)
    private List<Image> images;
    private boolean img;
    
    public boolean getOthersContact() {
        return othersContact;
    }

    public void setOthersContact(boolean othersContact) {
        this.othersContact = othersContact;
    }

    public List<Image> getImages() {
        return images;
    }

    public void setImages(List<Image> images) {
        this.images = images;
    }

    public boolean isImg() {
        return img;
    }

    public void setImg(boolean img) {
        this.img = img;
    }

    public CategoriaPersonal getPersonalCategorie() {
        return personalCategorie;
    }

    public void setPersonalCategorie(CategoriaPersonal personalCategorie) {
        this.personalCategorie = personalCategorie;
    }

    public String getAm() {
        return am;
    }

    public void setAm(String am) {
        this.am = am;
    }

    public String getSeeking() {
        return seeking;
    }

    public void setSeeking(String seeking) {
        this.seeking = seeking;
    }

    public int getYourAge() {
        return yourAge;
    }

    public void setYourAge(int yourAge) {
        this.yourAge = yourAge;
    }

}
